export default {
  state: {
    count: [],
  },
  mutations: {
    setCount(state, payload) {
      if (state.count.length === 0) {
        state.count.push(payload);
      } else {
        let flag = true;
        for (let obj of state.count) {
          if (obj.no === payload.no) {
            obj.val = payload.val;
            flag = false;
          }
        }
        if (flag) {
          state.count.push(payload);
        }
      }
    },
  },
};
